module("Model: bugstat.models.Report")

test("findAll", function(){
	stop(2000);
	bugstat.models.Report.findAll({}, function(reports){
		start()
		ok(reports)
        ok(reports.length)
        ok(reports[0].name)
        ok(reports[0].description)
	});
	
})

test("create", function(){
	stop(2000);
	new bugstat.models.Report({name: "dry cleaning", description: "take to street corner"}).save(function(report){
		start();
		ok(report);
        ok(report.id);
        equals(report.name,"dry cleaning")
        report.destroy()
	})
})
test("update" , function(){
	stop();
	new bugstat.models.Report({name: "cook dinner", description: "chicken"}).
            save(function(report){
            	equals(report.description,"chicken");
        		report.update({description: "steak"},function(report){
        			start()
        			equals(report.description,"steak");
        			report.destroy();
        		})
            })

});
test("destroy", function(){
	stop(2000);
	new bugstat.models.Report({name: "mow grass", description: "use riding mower"}).
            destroy(function(report){
            	start();
            	ok( true ,"Destroy called" )
            })
})